package com.fanrui.code.chess.mahjong;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import com.fanrui.proto.cmd.HuType;
import com.fanrui.proto.cmd.MahjongBaseRoomConfig;
import com.fanrui.proto.cmd.MahjongType;

public class GanZhouMahjongRules extends MahjongRules {

	private static Map<HuType, Integer> huTypeCorrespondenceTable = new HashMap<HuType, Integer>();
	static {
		huTypeCorrespondenceTable.put(HuType.PINGHU, 2);
		huTypeCorrespondenceTable.put(HuType.DIANPAO, 2);
		huTypeCorrespondenceTable.put(HuType.ZIMo, 2);
		huTypeCorrespondenceTable.put(HuType.XIAOQIDUI, 4);
		huTypeCorrespondenceTable.put(HuType.DAQIDUI, 8);
		huTypeCorrespondenceTable.put(HuType.SHISANLAN, 4);
		huTypeCorrespondenceTable.put(HuType.QIXINGSHISANLAN, 8);
		huTypeCorrespondenceTable.put(HuType.DEGUO, 5);
		huTypeCorrespondenceTable.put(HuType.DEZHONGDE, 10);
		huTypeCorrespondenceTable.put(HuType.JINGDIAO, 2);
		huTypeCorrespondenceTable.put(HuType.QIANGGANG, 2);
		huTypeCorrespondenceTable.put(HuType.GANGSHANGHUO, 2);
		huTypeCorrespondenceTable.put(HuType.TIANHU, 32);
		huTypeCorrespondenceTable.put(HuType.DIHU, 32);
	}

	private static Map<MahjongType, Integer> cards = new LinkedHashMap<MahjongType, Integer>();
	static {
		cards.put(MahjongType.WAN, 10);
		cards.put(MahjongType.TONG, 10);
		cards.put(MahjongType.TIAO, 10);
		cards.put(MahjongType.SAN, 8);
	}
	
	public GanZhouMahjongRules(MahjongBaseRoomConfig roomConfig) {
		super(roomConfig, cards, huTypeCorrespondenceTable);
	}

	@Override
	public int maximumCapacity() {
		return roomConfig.getPlayerNumber();
	}

}
